import axios from '@/libs/api.request'

/**
 * 散点图数据
 * @return {[type]}        [description]
 */
export const fetchFBChartData = params => {
  return axios.request({
    url: '/api/meterManage/distribution/getMeterUseYears',
    method: 'get',
    params
  })
}

/**
 * 获取参数
 * @return {[type]}        [description]
 */
export const fetchUserParams = params => {
  return axios.request({
    url: '/api/paras/meter/findOneByName?_t=' + new Date().getTime(),
    method: 'get',
    params
  })
}

/**
 * 获取热力图数据
 * @return {[type]}        [description]
 */
export const fetchRLChartData = params => {
  return axios.request({
    url: '/api/hot/meter/getMeterLocation',
    method: 'get',
    params
  })
}

/**
 * 柱状图数据
 * @return {[type]}        [description]
 */
export const fetchHBarCharData = params => {
  return axios.request({
    url: '/api/meterManage/meyerQuery/getMeterCountByYear',
    method: 'get',
    params
  })
}

/**
 * 饼图数据
 * @return {[type]}        [description]
 */
export const fetHPieChartData = params => {
  return axios.request({
    url: '/api/meterManage/meyerQuery/getMeterByAreaOf',
    method: 'get',
    params
  })
}

/**
 * 表具详情
 * @return {[type]}        [description]
 */
export const fetchMeterDetail = id => {
  return axios.request({
    url: '/api/meterManage/meyerQuery/getMeterBeanByMeterId/' + id,
    method: 'get'
  })
}

/**
 * 诊断报告
 * @return {[type]}        [description]
 */
export const fetchDiagReport = params => {
  return axios.request({
    url: '/api/meterManage/meyerQuery/getMeterLocation',
    method: 'get',
    params
  })
}

/**
 * 保存参数
 * @return {[type]}        [description]
 */
export const saveParams = data => {
  return axios.request({
    url: '/api/paras/meter/insert',
    method: 'post',
    data
  })
}

/**
 * desc: 请求矩形树图数据
 * param {type}
 * return: void
 */
export const getTreemapData = params => {
  return axios.request({
    url: '/api/meterManage/meyerQuery/getMeterGasCalssCountByYear',
    method: 'get',
    params
  })
}

/**
 * desc: 请求矩形树图数据
 * param {type}
 * return: void
 */
export const getTableDataByGasNature = data => {
  return axios.request({
    url: '/api/meterManage/meyerQuery/getMeterBeanListPage',
    method: 'post',
    data
  })
}
